proof of spanning set theorem